/*package com.wooophone.mpyeah.test;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import com.wooophone.mpyeah.biz.BrandBiz;
import com.wooophone.mpyeah.biz.exception.CannotDeleteException;
import com.wooophone.mpyeah.entity.Brand;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

@ContextConfiguration(locations = { "/spring/applicationContext*.xml" })
public class BrandBizTestCase extends AbstractJUnit4SpringContextTests {
	@Autowired
	BrandBiz brandBiz;

	@Test
	public void testGetChildren(){
		Map<String, Object> map = brandBiz.findBrandsAndChildBrandByCid("572fdb2b18df11e1aeb634d58f4cce24", 0, 10);
		int count=Integer.valueOf(map.get(BrandBiz.KEY_BRAND_LIST_COUNT).toString());
		@SuppressWarnings("unchecked")
		List<Brand> list=(List<Brand>) map.get(BrandBiz.KEY_BRAND_LIST_BRANDS);
		System.out.println(count);
		System.out.println(list.size());
	}
	
	@Test
	public void testGetById(){
		Brand brand=brandBiz.get("398165031a9f11e1afd739e7dfa49a17");
		System.out.println(brand.getId());
	}
	
	@Test public void test(){
		System.out.println(brandBiz);
		
		Brand brand=new Brand();
		
		brand.setName("惠普"+new Date().getTime());
		brand.setCreator("minglic");
		brand.setCredit(3);
		brand.setDescription("描述信息");
		brand.setEditor("minglic_edit");
		brand.setLogo("http://p7.qhimg.com/t01c75c4eb67da9ac81.jpg");
		brand.setMore("更多信息");
		brand.setStatus(1);
		brand.setTomlive("http://www.baidu.com");
		brand.setTop(false);
		brand.setAvailable(true);
		
		brandBiz.save(brand);
		
		System.out.println("保存后得到的ID："+brand.getId());
		
		try {
			int deleteCount = brandBiz.delete(brand.getId());
			System.out.println("成功删除数据：" +deleteCount+"条");
		} catch (CannotDeleteException e) {
			e.printStackTrace();
		}
	}
	
	
	@Test
	public void test5(){
		try {
			brandBiz.delete("27d21388230f11e1813600163e00540b");
		} catch (CannotDeleteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
*/